﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Structura.Infrastructure.Attributes;

namespace MusicStore.Entities
{
	[DataContract]
	public partial class Album : DomainObject<int>
	{
		public Album()
		{
			Tracks = new List<Track>();
		}

		//[DataMember]
		//public virtual int Id { get; set; }

		[DataMember]
		public virtual string Title { get; set; }

		[DataMember]
		public virtual string Author { get; set; }
		
		[DataMember]
		public virtual string Label { get; set; }
		
		[DataMember]
		public virtual string Genre { get; set; }
		
		[DataMember]
		public virtual DateTime PublicationDate { get; set; }
		
		[DataMember]
		public virtual string Note { get; set; }
		
		[DataMember]
		public virtual IList<Track> Tracks { get; set; }

		public virtual Track AddTrack(int number, string title, string duration)
		{
			Track t = new Track() {Duration = duration, Number = number, Title = title};
			Tracks.Add(t);
			return t;
		}
	}
}
